using Atlantic.XpoAutomaticProperties;
using DevExpress.Xpo;

namespace Tests.ObjectModel
{
   [XpoAutomaticProperties]
   public class Customer : Entity
   {
      #region Constructors

      public Customer()
      {
      }

      public Customer(Session session) : base(session)
      {
      }

      #endregion

      #region Properties

      [Association("Customer-AllContracts", typeof (Contract))]
      public XPCollection AllContracts { get; private set; }

      [Association("Customer-AllOrders", typeof (Order))]
      public XPCollection<Order> AllOrders { get; private set; }

      /// <summary>
      /// Would normally have an accessor like: get { return GetCollection("Contracts"); }
      /// </summary>
      [Association("Customer-Contracts", typeof (Contract))]
      public XPCollection Contracts { get; private set; }

      public string Name { get; set; }

      /// <summary>
      /// Would normally have an accessor like: return GetCollection&lt;Order&gt;("Orders");
      /// </summary>
      [Association("Customer-Orders", typeof (Order))]
      public XPCollection<Order> Orders { get; private set; }

      #endregion
   }
}